package com.liu.adapter;

import com.liu.keeppwd.SysState;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;

public class Sadapter extends BaseAdapter {
	String[] lst;
	Context con;

	public Sadapter(String[] lst, Context con) {
		this.lst = lst;
		this.con = con;
	}

	public String[] getLst() {
		return lst;
	}

	public void setLst(String[] lst) {
		this.lst = lst;
	}

	@Override
	public int getCount() {
		return lst.length;
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		TextView text = new TextView(con);
		text.setLayoutParams(new ListView.LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.WRAP_CONTENT));
		text.setTextSize(18);
		text.setGravity(0x13);
		text.setText(lst[arg0]);
		text.setTextColor(Color.rgb(255, 255, 255));
		text.setHeight(SysState.dp2pix(con, 55));
		text.setPadding(SysState.dp2pix(con, 55), 0, 0, 0);
		return text;
	}

}
